package com.qianyi.rabbitmq.controller;


import com.qianyi.rabbitmq.producer.MessageProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MessageProducerConttroller {


    @Autowired
    MessageProducer messageProducer;
    @RequestMapping(value = "/sendmsg",method = RequestMethod.POST)
    public  String  sendMsg(@RequestParam("msg")String msg){

       messageProducer.sendMessage("demo.queue",msg);

       return  msg;
    }
}
